package log;

import java.io.Serializable;

public class SimpleLogger implements Logger, Serializable {
	private static final long serialVersionUID = -3646868043164965006L;
	private final int logLevel;
	private final long startTime;

	public SimpleLogger() {
		this(Integer.MIN_VALUE);
	}

	public SimpleLogger(int logLevel) {
		this.logLevel = logLevel;
		this.startTime = System.currentTimeMillis();
	}

	@Override
	public void log(String text) {
		long time = System.currentTimeMillis() - startTime;
		System.out.println(time / 1000 + "s\t" + text);
	}

	@Override
	public void log(int level, String text) {
		if (level > logLevel)
			this.log(text);
	}

}
